using System;
namespace PUtil
{
	public class Util
	{
		/// <summary>
		/// Returns the smaller of the vector that is passed
		/// If the array is null throws IndexOutOfRangeException.
		/// </summary>
		public static int Menor(int[] v) {
			int menor= v[0];
			for(int i=1 ;i<v.Length ;i++)
				if(v[i] < menor)
					menor= v[i];
			return menor;
		}
		
		/// <summary>
		/// Returns the index of int in the array or -1 if is null.
		/// </summary>
		public static int IndexOf(int[] v, int num){
			for(int i=0 ;i<v.Length ;i++)
				if(v[i] == num)
					return i;
			return -1;
		}
		
	}
}

